// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import VueLazyload from 'vue-lazyload';
import animated from "animate.css";
import VueAMap from 'vue-amap';
import ElementUI from 'element-ui';
import FontAwesome from "font-awesome/css/font-awesome.min.css";
import VueI18n from 'vue-i18n';

import 'element-ui/lib/theme-chalk/index.css';
import "./assets/css/common.css";
import 'hover.css'

const appConfig = require("../public/config/index.js");

window._AMapSecurityConfig = {
  securityJsCode:appConfig.app.security,
}

Vue.config.productionTip = false
Vue.use(animated);
Vue.use(VueAMap);
Vue.use(ElementUI);
Vue.use(VueI18n);
Vue.use(VueLazyload, {
  loading: require('./assets/img/loading.jpg'),
  error:require('./assets/img/loading.jpg'),
})

//高德地图配置
VueAMap.initAMapApiLoader({
  key: appConfig.app.amapKey,
  plugin: ['AMap.Geolocation','AMap.PlaceSearch'],
  v: '1.4.4'
});

//多语言配置
const i18n = new VueI18n({
  locale: localStorage.getItem('lang') || 'zh',
  messages: {
     'zh': require('@/assets/language/language-zh'),
     'en': require('@/assets/language/language-en'),
  }
})


new Vue({
  el: '#app',
  router,
  i18n,
  components: { App },
  template: '<App/>'
})
